
package JDBC;

import java.sql.*;

public class DatabaseConnection {
    

    // PARÀMETROS ORACLE
    private final static String DRIVER_CLASS_NAME = "oracle.jdbc.driver.OracleDriver";
    private final static String DRIVER_URL = "jdbc:oracle:thin:@localhost:1521:XE";
    private final static String USUARIO = "minor";
    private final static String CLAVE = "minor";
    
 
    
    private static Connection connection = null;
    private static PreparedStatement preparedStatement = null;
    private static ResultSet resultSet = null;
    
    // Método que realiza la conexión con la base de datos
    public static Connection getConexion() throws SQLException {
       try {
            Class.forName(DRIVER_CLASS_NAME);
       }
       catch (ClassNotFoundException e) {
            e.printStackTrace(System.err);
        }
       return DriverManager.getConnection(DRIVER_URL, USUARIO, CLAVE);
    }
}
